<template>
    <div class="singer-home">
        <!-- <导航栏> -->
        <van-nav-bar
            title="歌手信息"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            />
            <img :src="singer.singer_pic" alt="">
            <!-- 标签页 -->
            <van-tabs v-model="active">
                <van-tab title="百科">
                    <SingerIntro :singeid='id'/>
                </van-tab>
                <van-tab title="歌曲">
                    <SingerSong :singeid='id'/>
                </van-tab>
            </van-tabs>
    </div>
</template>
<script>
import SingerIntro from "./components/SingerIntro.vue";
import SingerSong from "./components/SingerSong.vue";

export default {
    data(){
        return {
            active: 0,
            id: this.$router.params.id,
            singer:{}
        };
    },
     created(){
    this.singer =this.$store.state.Singer

  },
    mounted:{
        onClickLeft(){
            //如果历史天气记录大于1 ，那么返回到上一层，如果历史记录小于等于1，返回到跟路由
            window.history.length > 1 ? this.$router.go(-1) : this.$router.push("/");
        },
    },
    components:{
        SingerIntro,
        SingerSong
    },
};
</script>
<style scoped>
</style>
